from chatterbot import ChatBot
from chatterbot.trainers import ListTrainer


'''
This is an example showing how to train a chat bot using the
ChatterBot ListTrainer.
'''

chatbot = ChatBot('Hyundai CAR Bot')

# Start by training our bot with the ChatterBot corpus data
trainer = ListTrainer(chatbot)
trainer.train([
    'ccs是什么',
    'ccs是连接car system',
    '怎么使用',
    '首先要注册用户名,然后开通车辆',
    '购买了现代起亚汽车吗',
    '是',
    '请进入网站输入信息[bluelink 登录点击]'
])
trainer.train([
    '我的车辆有问题吗？',
    '首先在系统中确认一下车辆状态信息。车辆状态如下'
])
trainer.train([
    '我的车辆有问题吗？',
    '首先在系统中确认一下车辆状态信息。车辆状态如下'
])
trainer.train([
    '你是谁呀？',
    '您好，我是现代汽车机器人，有什么问题吗？',
    '首先在系统中确认一下车辆状态信息'
])
'''
trainer.train([
    'Hello, how are you?',
    'I am doing well.',
    'That is good to hear.',
    'Thank you'
])
'''
# You can train with a second list of data to add response variations


# Now let's get a response to a greeting
#response = chatbot.get_response('How are you doing today?')
#print(response)
while True:
    try:
        request=input('我的 Question:')
        response = chatbot.get_response(request)
        print('Hyundai CAR Bot: ',response)

    except(KeyboardInterrupt, EOFError, SystemExit):
        break